package com.cqw.sms.controller;

import com.cqw.sms.service.SmsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/sms")
public class SmsController {


    @Resource
    private SmsService smsService;

    @GetMapping("/send")
    public String sendSms(String mobile) throws Exception {
        smsService.sendSms(mobile);
        return "OK";
    }

    @GetMapping("/send1")
    public String sendSms1(String mobile) throws Exception {
        smsService.sendSms1(mobile);
        return "OK";
    }


    public static void main(String[] args) {
        int i = 0;
        try {
            i++;
            int j = 10 / 0;
        } catch (Exception e) {
            System.out.println(i);
        }
    }


}
